<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/29
 * Time: 17:21
 */

namespace app\common\validate;

use think\Validate;

class UserFavorite extends Validate {

    protected $rule = [
        'article_id' => 'require|number|gt:0',
        'user_id' => 'require|number|gt:0',
    ];

    protected $message = [
        'article_id.require' => '文章ID必须',
        'article_id.max' => '文章ID必须大于0',
        'article_id.number' => '文章ID必须是数字',
        'user_id.require' => '用户ID必须',
        'user_id.max' => '用户ID必须大于0',
        'user_id.number' => '用户ID必须是数字',
    ];

    protected $scene = [
        'add' => ['article_id', 'user_id'],
    ];
}